Loading...
 

Link (Widget)

link

Link(name~aliasName, flags, x, y, w, h, text)

198487

Parameters

Parameters Description
name Identifier / access printout (FillWindow)
aliasName an additional identifier
flags Flags
x * Position X (in minicells)
y * Position Y (in Minicells)
w Width (in minicells)
h Height (in minicells)
text Text as string or (multilingual) as multiple string constant

* - required parameter

Description

A link widget is very similar to a prompt. The link widget can display any text that is not editable by the user and can be filled with STRINGs or MLSTRINGs from object access paths via FillWindow just like the prompt. Since link widgets are not editable, they do not react to DrainWindow.

Similar to the prompt, the widget width is optional. If no width is specified, the widget calculates the minimum width necessary to display the text. Since the widget can also display multi-line text (line break: \n), the height can also be specified or calculated automatically based on the font height and number of lines.

In contrast to the prompt, the link widget interprets the content of the string as simplified HTML markup, which allows you to mark (multiple) text passages as links. The only allowed markup element is the anchor element for which the following attributes are valid:

Link Attributes

Since the markup must be specified within a string, the link widget allows you to enclose the attribute values in single quotes(') or, if the attribute value does not contain spaces, without enclosing characters.

Attribute Meaning
href

The link url. If the link element is clicked, the specified page opens in the browser. If ClassiX runs on a native Windows environment, you can also specify folder & file paths here, which are opened by clicking on the link element in the explorer.

If the link element has an href attribute, then no SELECT is sent to the widget, whether id is set or not. The id is ignored in this case.

id

An identifier for the link element. This identifier must be a valid InstantView identifier (starts with letter or _ and does not contain special characters/spaces), otherwise the link widget will return an error message. This attribute is ignored if the same link element already has an href attribute set.

If no href attribute is set, then the link widget receives a SELECT@id event(in analogy to cell widgets) when the link element is clicked, whereby id is replaced by the id specified in the attribute. In this way, if several link elements within a link widget are used, it is possible to distinguish which link element was clicked. It is allowed to use an id multiple times.

If the link element contains neither href nor id, then clicking on the link element only triggers SELECT.

old This attribute contains a tooltip text that is displayed when the user hovers the mouse over the link element. Unlike other widgets, Link does not react to the TOOLTIP flag and does not send a TOOLTIP message, so that each link element can define its own tooltip.

The link text itself must not contain any further markup. Line breaks (\n) within the link text are allowed. The basis for the native display of the widget is the SysLink-Control.

The link elements only react to a regular mouse click (or an Enter/Space if selected). Accordingly, the link widget only receives SELECT- or SELECT@id events. Other events are currently not supported by the widget.

If the link widget is selected, the user can use CTRL+TAB to switch through the individual link elements.

MorphIT formatting

4.3.0

If a link widget is displayed in the browser via MorphIT, the display can be adjusted via CSS specifications.

The slot morphIt.format is provided for this purpose. In this slot a string can be stored, which corresponds to the syntax of a JSON object and defines the CSS properties to be set for individual selectors. All CSS information is only evaluated locally within the widget. The empty selector "" refers to the entire link widget.

{ "<selector>": { "<property>": "<value>" } }
Example:
{ "": { "height": "auto !important", "font-size": "large" }, "a": { "color" : "black" }, "a:hover": { "color" : "black", "text-decoration" : "none" } }

Attention: If, for example, you change the effective height of the widget's content using font-size without changing the text, the calculated height of the widget will no longer match it. As a result, texts can then be automatically cut off.
In these cases you can either set the height of the widget in InstantView or - as in the example above - the CSS property height: auto !important is given to the widget.

Flags

Flag Description
HIDDEN The link remains invisible until Instruction Show makes it appear on the screen.
FONT(k) k = 0, 1, ..., 9 selects an entry in the font table. The font entered there is used. Fonts are entered with PMFonts in the
registered. Predefined fonts exist for 0, 1 and 2. The font index can be changed later with SetFont.
JUSTIFY_RIGHT Aligns the text within the link to the right.
JUSTIFY_CENTER Centers the text within the link. This does not work natively due to the limitations of the SysLink widget used. Under MorphIT the link text is correctly centered.

Example:

The following code:

Link Widget

Is displayed as follows:

Link Widget Rendered